package org.lee.status.app.event;

import org.lee.status.app.Result;
import org.lee.status.app.State;
import org.lee.status.app.activity.ActivityService;
import org.lee.status.app.activity.Status;

/**
 * PassState
 * 活动状态：审核通过
 *
 * @author dralee
 * @date 2021-11-24 09:43:59
 **/
public class PassState extends State {
    @Override
    public Result arraignment(String activityId, Status currentStatus) {
        return Result.failure("已审核通过不可重复提审");
    }

    @Override
    public Result checkPass(String activityId, Status currentStatus) {
        return Result.failure("已审核通过不可重复审核");
    }

    @Override
    public Result checkRefuse(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.REFUSE);
        return Result.failure("活动审核拒绝完成");
    }

    @Override
    public Result checkRevoke(String activityId, Status currentStatus) {
        return Result.failure("审核通过不可撤消审核（可先拒绝审核）");
    }

    @Override
    public Result close(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.CLOSE);
        return Result.success("活动关闭成功");
    }

    @Override
    public Result open(String activityId, Status currentStatus) {
        return Result.failure("非关闭活动不可开启");
    }

    @Override
    public Result doing(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.DOING);
        return Result.failure("活动变更活动中完成");
    }
}
